import request from "@/utils/request.js";

// 单文件上传
export const uploadBySingle = function(key, data, file) {
	return request.upload(
		'upload/single',
		key,
		data,
		file
	);
}

/**
 * 切片上传
 * @param {Object} key
 * @param {Object} data
 * @param {Object} file
 */
export const uploadByChunk = function(key, data, file) {
	return request.upload(
		'upload/chunk',
		key,
		data,
		file
	);
}

/**
 * 多文件上传
 * @param {Object} key
 * @param {Object} data
 * @param {Object} files
 */
export const uploadByMuti = function(key, data, files) {
	return request.upload(
		'upload/muti',
		key,
		files
	);
}